import AddPurchase from "./addPurchase"
import EditPurchase from "./editPurchase"
import PurchaseHome from "./purchaseHome"

import React, { useRef, useState } from 'react'

const purchaseManagement = () => {
    const [isShow, setShow] = useState(0)

    const ShowNode = () => {
        const getChildCount = (val) => {
            setShow(val)
        };

        switch (isShow) {
            case 0:
                return <PurchaseHome getCount={getChildCount} ></PurchaseHome>
            case 1:
                return <AddPurchase getCount={getChildCount}></AddPurchase>
            case 2:
                return <EditPurchase getCount={getChildCount}></EditPurchase>
            default:
                break;
        }
    }

    return (
        <div>
            <div>
                {<ShowNode />}
            </div>
        </div>
    );
}

export default purchaseManagement;